<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Medicine Stock Management</title>

	<?php echo css_asset('bootstrap.css'); ?>
	<?php echo css_asset('bootstrap-theme.css'); ?>	
	
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
	

</head>

<body>
	<?php echo js_asset('bootstrap.min.js'); ?>
	<?php echo js_asset('jquery.validate.js'); ?>
	<?php echo js_asset('validate.input.story.js'); ?>

	<div id="header">
		<div class="half left">
			<div id="lside">
				<ul class="nav nav-pills nav-stacked">
					<li><a href="<?php echo base_url();?>pro_ctrl">
					<b><font color="c9c9c9"><span class="glyphicon glyphicon-user"></span>&nbsp;
					<?php $session_data = $this->session->userdata('logged_in');?>
					<?php echo $session_data['username']; ?></font>
					<span class="navbar-right"><font color="#1ce335">Online&nbsp;
					<span class="glyphicon glyphicon-map-marker"></span></font></span></b></a></li>
					<li class="divider"></li>
				</ul>
			</div>
		</div>

		<div class="half right">
			<nav class="navbar navbar-inverse" role="navigation">
				<!-- Brand and toggle get grouped for better mobile display -->
				<div class="navbar-header">
					<button type="button" class="navbar-toggle" data-toggle="collapse"
						data-target="#bs-example-navbar-collapse-1">
						<span class="sr-only">Toggle navigation</span> <span
							class="icon-bar"></span> <span class="icon-bar"></span> <span
							class="icon-bar"></span>
					</button>
					<a class="navbar-brand">Medicine Stock Management</a>
				</div>

				<!-- Collect the nav links, forms, and other content for toggling -->
				<div class="collapse navbar-collapse"
					id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">

					</ul>
					<!-- <form class="navbar-form navbar-left" role="search">
						<div class="form-group">
							<input type="text" class="form-control" placeholder="Search">
						</div>
						<button type="submit" class="btn btn-default">Submit</button>
					</form> -->
					<ul class="nav navbar-nav navbar-right">
						<li class="dropdown"><a href="#"
							class="dropdown-toggle glyphicon glyphicon-list"
							data-toggle="dropdown"> <b class="caret"></b></a>
							<ul class="dropdown-menu">
								<li><a href="<?php echo base_url();?>sale_ctrl">Sale Page</a></li>
								<li><a href="<?php echo base_url();?>pro_ctrl">Profile</a></li>
								<li class="divider"></li>
								<li><a href="<?php echo base_url();?>login_control/logout">Logout</a></li>
							</ul></li>
					</ul>
				</div>
				<!-- /.navbar-collapse -->
			</nav>
		</div>
	</div>

	<div id="under_header">
		<div class="half left">
			<div id="lside">
				<div class="list-group" align="center">
					<a class="list-group-item active"><b> Admin Site </b></a>
				</div>
			</div>
		</div>
		<div class="half right">
			<ol class="breadcrumb">
				<li>&nbsp;</li>
				<li><b>Account</b></li>
			</ol>
		</div>
	</div>

	<div id="content">
		<div class="half left">
			<div id="lside">
				<ul class="nav nav-pills nav-stacked">
					<li class="divider"></li>
					<li><a href="<?php echo base_url();?>inv_ctrl"><span
							class="glyphicon glyphicon-home">&nbsp;&nbsp;</span><b>Home</b></a></li>
					<li><a href="<?php echo base_url();?>inv_ctrl/inventory"><span
							class="glyphicon glyphicon-stats">&nbsp;&nbsp;</span><b>Inventory</b></a></li>
					<li><a href="<?php echo base_url();?>sol_ctrl"><span
							class="glyphicon glyphicon-barcode">&nbsp;&nbsp;</span><b>Sold
								List</b></a></li>
					<li><a href="<?php echo base_url();?>pur_ctrl"><span
							class="glyphicon glyphicon-shopping-cart">&nbsp;&nbsp;</span><b>Purchasing</b></a></li>
					<li><a href="<?php echo base_url();?>exp_ctrl"><span
							class="glyphicon glyphicon-time">&nbsp;&nbsp;</span><b>Expiration
								Check</b></a></li>
					<li class="active"><a
						href="<?php echo base_url();?>acc_ctrl"><span
							class="glyphicon glyphicon-user">&nbsp;&nbsp;</span><b>Account</b></a></li>
				</ul>
			</div>
		</div>

		<div class="half right">

			<feldset>

			<div class="panel panel-primary">
				<div class="panel-heading">
					<h3 class="panel-title">Users Detail</h3>
				</div>

				<div class="panel-group" id="accordion">
					<div class="panel panel-default">
						<div class="panel-heading">
							<h4 class="panel-title">
								<a data-toggle="collapse" data-parent="#accordion"
									href="#collapseOne"> Add User +</a>
							</h4>
						</div>
						<div id="collapseOne" class="panel-collapse collapse">
							<div class="panel-body">
							
							
								<form id="form_validate" method="post" action="<?php echo base_url();?>acc_ctrl/signup">
								
									<div class="row">
									<div class="col-lg-4">
										<label>Username : </label><input type="text" name="username" id="username"
											class="form-control" placeholder="Username" required="true">
									</div>
									<div class="col-lg-4">
										<label>Password : </label><input type="password" name="password" id="password"
											class="form-control" placeholder="Password" required="true">
									</div>
									<div class="col-lg-4">
										<label>Confirm password : </label><input type="password"
										 name="password2"	id="password2" class="form-control"
											placeholder="Confirm Password">
									</div>
								</div>
								<div class="row">
									<div class="col-lg-4">
										<label>Name : </label><input type="text" name="name" class="form-control"
											id="name" placeholder="Name" required="true">
									</div>
									<div class="col-lg-4">
										<label>Lastname : </label><input type="text" name="lastname" id="lastname"
											class="form-control" placeholder="Lastname" required="true">
									</div>
									<div class="col-lg-4">
										<label>User Type : </label><select class="form-control"
											id="user_type" name="user_type">
											<?php foreach($type as $ty){?>
											<option value="<?php echo $ty['usertype_id']; ?>">
											<?php echo $ty['user_type']; ?></option>
											<?php }?>
										</select>
									</div>
								</div>
								<div class="row">
									<div class="col-lg-1">
										<label>Confirm:</label>
										<button class="btn btn-primary" type="submit" name="submit">Add</button>
									</div>
									<div class="col-lg-1">
										<label>&nbsp;</label>
										<button class="btn btn-danger" type="reset">Reset</button>
									</div>
								</div>
								
								</form>

							</div>
						</div>
					</div>
					</div>

					<div class="panel panel-info"> <!-- Default panel contents -->
						<div class="panel-heading">
							<span class="glyphicon glyphicon-user"></span> Account list
						</div>
				
						<div class="panel-body">
					
						<table class="table table-hover" width="100%">
							<thead>
								<td align="center"><b>#</b></td>
								<td align="center"><b>Name</b></td>
								<td align="center"><b>Lastname</b></td>
								<td align="center"><b>Username</b></td>
								<td align="center"><b>Status</b></td>
								<td align="center"><b>Customize</b></td>
							</thead>
							<tbody>
							
							<?php for($i=0;$i<count($result);$i++){ ?>
							
							
								<tr>
									<td align="center"> <?php echo $i+1;?></td>
									<td align="center"> <?php echo $result[$i]['name'];?></td>
									<td align="center"> <?php echo $result[$i]['lastname'];?></td>
									<td align="center"> <?php echo $result[$i]['username'];?></td>
									<td align="center"> <?php echo $result[$i]['user_type'];?></td>
									<td align="center"><a data-toggle="modal" data-target="#myModal">
									<span class="glyphicon glyphicon-pencil"></span></a>&nbsp;&nbsp;&nbsp;
									<a href="<?php echo base_url();?>acc_ctrl/delete_user/<?php echo $result[$i]['user_id'];?>">
									<span class="glyphicon glyphicon-trash"></span></a></td>
								</tr>
							<?php }  ?>

								<!-- Modal -->
								<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
									aria-labelledby="myModalLabel" aria-hidden="true">
									<div class="modal-dialog">
										<div class="modal-content">
											<div class="modal-header">
												<button type="button" class="close" data-dismiss="modal"
													aria-hidden="true">&times;</button>
												<h4 class="modal-title" id="myModalLabel">Modify user information</h4>
											</div>
											<div class="modal-body">

												<form name="editacc" id="editacc" action="<?php echo base_url();?>acc_ctrl/update_user_data/<?php echo $session_data["usertype_id"]; ?>" method="post">
													<div class="row">
														<div class="col-lg-4">
															<label>Username : </label><input type="text" class="form-control" 
															placeholder="Username">
														</div>
														<div class="col-lg-4">
															<label>Password : </label><input type="password" class="form-control" 
															placeholder="Password" required="true" maxlength="16">
														</div>
														<div class="col-lg-4">
															<label>Confirm Password : </label><input type="text" class="form-control" 
															placeholder="Confirm password" required="true" maxlength="16">
														</div>
													</div>
													<div class="row">
														<div class="col-lg-4">
															<label>Name : </label><input type="text"
																class="form-control" placeholder="Name">
														</div>
														<div class="col-lg-4">
															<label>Lastname : </label><input type="text"
																class="form-control" placeholder="Lastname">
														</div>
														<div class="col-lg-4">
															<label>Status : </label><select class="form-control">
																<option>Admin</option>
																<option>User</option>
															</select>
														</div>
													</div>
												</form>

											</div>
											<div class="modal-footer">
												<button type="button" class="btn btn-default"
													data-dismiss="modal">Close</button>
												<button type="button" class="btn btn-primary">Save changes</button>
											</div>
										</div><!-- /.modal-content -->
									</div><!-- /.modal-dialog -->
								</div><!-- /.modal -->

							</tbody>
						</table>
					</div>
					</div>

			</div>

			<div class="footer">
				<nav class="navbar navbar-default navbar-fixed-bottom" role="navigation">
					<ul class="nav nav-tabs">
						<li>&nbsp;</li>
					</ul>
				</nav>
			</div>
			</feldset>
			<br />

</body>

</html>
